const express = require('express');
const expect = require('chai').expect;
const supertest = require('supertest');
const app = require('../server.js');
const request = supertest(app);

describe('/', function() {
    it('should be return home ', function(done) {
        request.get('/')
            .expect(200)
            .end((err, res) => {
                if (err) {
                    return done(err)
                } else {
                    done();
                }
            })

    });
});

describe('/register', function() {
    it('should return 200', function(done) {
        request.post('/register')
            .send({
                username: "chong",
                password: "~Aa15820361617",
                email: "1079936039@qq.com"
            })
            .expect(200)
            .end((err, res) => {
                if (err) {
                    return done(err);
                } else {
                    done();
                }
            })
    });
});